package com.bytedance.ttnet;

import com.bytedance.retrofit2.Call;
import com.bytedance.retrofit2.client.Header;
import com.bytedance.retrofit2.http.AddCommonParam;
import com.bytedance.retrofit2.http.Body;
import com.bytedance.retrofit2.http.ExtraInfo;
import com.bytedance.retrofit2.http.FieldMap;
import com.bytedance.retrofit2.http.FormUrlEncoded;
import com.bytedance.retrofit2.http.GET;
import com.bytedance.retrofit2.http.HeaderList;
import com.bytedance.retrofit2.http.MaxLength;
import com.bytedance.retrofit2.http.Multipart;
import com.bytedance.retrofit2.http.POST;
import com.bytedance.retrofit2.http.PartMap;
import com.bytedance.retrofit2.http.QueryMap;
import com.bytedance.retrofit2.http.Streaming;
import com.bytedance.retrofit2.http.Url;
import com.bytedance.retrofit2.mime.TypedInput;
import com.bytedance.retrofit2.mime.TypedOutput;

import java.util.List;
import java.util.Map;

public interface INetworkApi {
    @GET
    Call<String> doGet(@AddCommonParam boolean addCommonParams,
                       @MaxLength int maxLength,
                       @Url String url,
                       @QueryMap(encoded = true) Map<String, String> queryMap,
                       @HeaderList List<Header> headerList,
                       @ExtraInfo Object extraInfo);

    @FormUrlEncoded
    @POST
    Call<String> doPost(@MaxLength int maxLength,
                        @Url String url,
                        @QueryMap Map<String, String> queryMap,
                        @FieldMap(a = true) Map<String, String> fieldMap,
                        @HeaderList List<Header> headerList,
                        @ExtraInfo Object extraInfo);

    @Streaming
    @GET
    Call<TypedInput> downloadFile(@AddCommonParam boolean addCommonParam,
                                  @MaxLength int maxLength,
                                  @Url String url,
                                  @QueryMap(encoded = true) Map<String, String> queryMap);

    @Streaming
    @GET
    Call<TypedInput> downloadFile(@AddCommonParam boolean addCommonParam,
                                  @MaxLength int maxLength,
                                  @Url String url,
                                  @QueryMap(encoded = true) Map<String, String> queryMap,
                                  @HeaderList List<Header> list,
                                  @ExtraInfo Object obj);

    @POST
    Call<String> postBody(@MaxLength int maxLength,
                          @Url String url,
                          @QueryMap(encoded = true) Map<String, String> queryMap,
                          @Body TypedOutput typedOutput,
                          @HeaderList List<Header> headerList);

    @Multipart
    @POST
    Call<String> postMultiPart(@MaxLength int maxLength,
                               @Url String url,
                               @QueryMap(encoded = true) Map<String, String> queryMap,
                               @PartMap Map<String, TypedOutput> partMap,
                               @HeaderList List<Header> headerList);
}